﻿using Abp.Domian.UserInfo;
using Abp.Dto.UserDTO;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Repositories;

namespace Abp.Application.User
{
    public class UserAppService : ApplicationService, IUserAppService
    {
        private readonly IRepository<Users> _userRepository;

        public UserAppService(IRepository<Users> userRepository)
        {
            _userRepository = userRepository;
        }

        public async Task<UserDTO> Get(string userNo, string password)
        {
            var user = await _userRepository.GetAsync(m => m.UserNo == userNo && m.Password == password);
            var dto = ObjectMapper.Map<Users, UserDTO>(user);
            return dto;
        }
    }
}
